package cn.initcap.designpattern.pattern.structural.decorator;

/**
 * 装饰者模式（抽象的装饰者继承抽象的实体）
 *
 * @author initcap
 * @date 2018/8/28 AM9:13
 */
public abstract class AbstractDecorator extends AbstractBattercake {
    private AbstractBattercake abstractBattercake;

    public AbstractDecorator(AbstractBattercake abstractBattercake) {
        this.abstractBattercake = abstractBattercake;
    }

    /**
     * 需要处理的事情
     */
    protected abstract void doSomething();

    @Override
    protected String getDesc() {
        return this.abstractBattercake.getDesc();
    }

    @Override
    protected int cost() {
        return this.abstractBattercake.cost();
    }
}
